import std/parsecfg
import std/os

var dict = newConfig()
echo "欢迎使用"
echo "请输入人物名称"
var name = stdin.readLine()
echo "请输入性别"
var sex = stdin.readLine()
echo "请输入年龄"
var age = stdin.readLine()
#echo "请输入人物设定"
echo "请输入你的称呼"
var username = stdin.readLine()
echo "请输入智能体文件名称"
var filename = stdin.readLine()
echo "人物创建完成"

if not dirExists("char"):
  createDir("char")
var file = open("char/" & filename & ".ini",fmWrite)
dict.setSectionKey(name,"name",name)
dict.setSectionKey(name,"sex",sex)
dict.setSectionKey(name,"age",age)
dict.setSectionKey(name,"username",username)
file.write(dict)
file.close()